import { reqAddressInfo,reqOrderInfo} from "@/api"
export default {
	namespaced:true,
	actions:{
		//获取用户地址信息
		async getUserAddress(context) {
			let result = await reqAddressInfo();
			if (result.code == 200) {
			   context.commit("GETUSERADDRESS", result.data);
			}
		},
		//获取商品清单数据
		async getOrderInfo({commit}) {
			let result = await reqOrderInfo();
			if(result.code==200){
			  commit("GETORDERINFO",result.data);
			}
		},
	},

	mutations:{
	    GETUSERADDRESS(state, address) {
			state.addressInfo = address;
		},
		GETORDERINFO(state,orderInfo){
			state.orderInfo = orderInfo;
		 }
	},

	state:{
		addressInfo: [],
		orderInfo:{}
	},

	getters:{
		 
	},

}